//********************************************************************************************************
// Product Name: MapWindow.dll Alpha
// Description:  Low level interfaces that allow separate components to use objects that are defined
//               in completely independant libraries so long as they satisfy the basic interface requirements.
//********************************************************************************************************
// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); 
// you may not use this file except in compliance with the License. You may obtain a copy of the License at 
// http://www.mozilla.org/MPL/ 
//
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 
// ANY KIND, either express or implied. See the License for the specificlanguage governing rights and 
// limitations under the License. 
//
// The Original Code is MapWindow.Interfaces
//
// The Initial Developer of this Original Code is Ted Dunsford. Created in August, 2007.
// 
// Contributor(s): (Open source contributors should list themselves and their modifications here). 
//
//********************************************************************************************************
using System;
using System.Collections.Generic;
using System.Text;


using MapWindow.Components;
using MapWindow.Main;
using MapWindow.Geometries;

namespace MapWindow.Data
{
    /// <summary>
    /// A layer contains a list of features of a specific type that matches the geometry type.
    /// While this supports IRenderable, this merely forwards the drawing instructions to
    /// each of its members, but does not allow the control of any default layer properties here.
    /// Calling FeatureDataSource.Open will create a number of layers of the appropriate
    /// specific type and also create a specific layer type that is derived from this class
    /// that does expose default "layer" properties, as well as the symbology elements.
    /// </summary>
    public interface IFeatureLayer 
    {

        
        /// <summary>
        /// Gets the data source that is associated with this feature layer.
        /// This is read only to prevent confusion since a datasource would
        /// have to perform actions internally to add a new layer.
        /// </summary>
        IFeatureDataSource DataSource
        {
            get;
        }

        /// <summary>
        /// Gets the DataTable associated with this specific feature.
        /// </summary>
        System.Data.DataTable DataTable
        {
            get;
        }

        /// <summary>
        /// Returns the bounding envelope in spatial coordinates for the entire layer
        /// </summary>
        IEnvelope Envelope
        {
            get;
        }

   
        /// <summary>
        /// Gets the list of all the features that are included in this layer.
        /// </summary>
        List<IFeature> Features
        {
            get;
        }

        /// <summary>
        /// Gets the list of all the fields using the column name as a key
        /// </summary>
        Dictionary<string, Field> Fields
        {
            get;
        }


        /// <summary>
        /// Gets the string filename for this feature layer, if any
        /// </summary>
        string Filename
        {
            get;
        }

        /// <summary>
        /// Gets or sets a string name for this layer.
        /// </summary>
        string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Saves the information in the Layers provided by this datasource onto its existing file location
        /// </summary>
        void Save();

        /// <summary>
        /// Saves a datasource to the file.
        /// </summary>
        /// <param name="Filename">The string filename location to save to</param>
        /// <param name="Overwrite">Boolean, if this is true then it will overwrite a file of the existing name.</param>
        void SaveAs(string Filename, bool Overwrite);

        /// <summary>
        /// Each layer can only have one type of geometry (Point, Line or Polygon).
        /// Attempting to add the wrong type of geometry once the type has been
        /// established will cause an error.  Adding the first geometry should
        /// automatically establish the type.
        /// </summary>
        FeatureTypes FeatureType
        {
            get;
        }

       
       

    }
}
